<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset={$defaultCharset|escape}" />
	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/pkp.css" type="text/css" />
	

	<link rel="stylesheet" href="{$baseUrl}/lib/pkp/styles/common.css" type="text/css" />
	<link rel="stylesheet" href="{$baseUrl}/styles/common.css" type="text/css" />

	<link rel="stylesheet" type="text/css" href="{$baseUrl}/styles/dm.css">


	<!-- Base Jquery -->
	{*
	{if $allowCDN}<script type="text/javascript" src="http://www.google.com/jsapi"></script>
	<script type="text/javascript">{literal}
		// Provide a local fallback if the CDN cannot be reached
		if (typeof google == 'undefined') {
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));
			document.write(unescape("%3Cscript src='{/literal}{$baseUrl}{literal}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js' type='text/javascript'%3E%3C/script%3E"));
		} else {
			google.load("jquery", "{/literal}{$smarty.const.CDN_JQUERY_VERSION}{literal}");
			google.load("jqueryui", "{/literal}{$smarty.const.CDN_JQUERY_UI_VERSION}{literal}");
		}
	{/literal}</script>
	{else}
	*}
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="{$baseUrl}/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>
	{*{/if}
	*}

	<script type="text/javascript" src="{$baseUrl}/classes/acct/js/danhmuc.js"></script>

</head>


{strip}
{assign var="pageTitle" value="Danh mục Đơn vị"}
{assign var="socot" value="8"}
{include file="acct/acctNavbar.tpl"}
{include file="acct/breadcrumbs.tpl"}
{url|assign:"InsUrl" op="DMDV_Ins"}
{/strip}


<div class = "DMtitle" >
<strong>DANH MỤC ĐƠN VỊ </strong>
</div>
<div class = "search" id = "search">
{foreach from=$alphaList item=letter}<a href="javascript:void(0);" onclick="refreshDMDV('{$letter|escape}', '{$url}');">{if $letter == $dmdv_initial}{$letter|escape}{else}{$letter|escape}{/if}</a> {/foreach}
<BR>
<BR>

<form method="post" action="{url page='acctKT' op='KT_DANHMUC' ChiTiet = 'DV'}">
<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>
	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>

	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input type="submit" value="{translate key="common.search"}" class="button" />
	</form>

</div>

<div id = "create" style="display: none; width:80%;  margin-left: auto; margin-right: auto;">
	<table width="100%" style = " border: thin black solid;">
	<tr valign="top" height = "40px">
	<td colspan = "2" id = "create_title" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-size: 1.5em; font-weight: bold; border-width: 0;" > Thêm Chi tiết mới</td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="madv">Mã đơn vị:*</label></td>
		<td width="80%" class="value"><input type="text" name="madv" value="{$madv}" id="madv" size="40" maxlength="70" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="tendv">Tên đơn vị:*</label></td>
		<td width="80%" class="value"><input type="text" name="tendv" value="{$tendv}" id="tendv" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="masothue">Mã số thuế:</label></td>
		<td width="80%" class="value"><input type="text" name="masothue" value="{$masothue}" id="masothue" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="diachi">Địa chỉ:</label></td>
		<td width="80%" class="value"><input type="text" name="diachi" value="{$diachi}" id="diachi" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="dienthoai">Điện thoại:</label></td>
		<td width="80%" class="value"><input type="text" name="dienthoai" value="{$dienthoai}" id="dienthoai" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="fax">Fax:</label></td>
		<td width="80%" class="value"><input type="text" name="fax" value="{$fax}" id="fax" size="40" style="width:99%" class="textField" /></td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="daidien">Đại diện:</label></td>
		<td width="80%" class="value"><input type="text" name="daidien" value="{$daidien}" id="daidien" size="40" style="width:99%" class="textField" /></td>
	</tr>


	<tr valign="top">



	</tr>

	<tr valign="top" height = "40px">
	<td colspan = "2" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-weight: bold;"> 
	
	<input type="button" id = "createbutton" value="Thêm mới" class="button defaultButton" onclick="SaveDMDV('{$InsUrl}');" /> <input type="button" value="{translate key="common.cancel"}" class="button defaultButton" onclick="RTFcreate();" />
	</td></tr>

	</table>
	<br>
	<br>
</div> 


<table width = "100%">
<tr>
<td width = "50%">
	<div id = "btnThem"> 
	<input type="button" id="button_id" value="Th&#234;m Chi tiết mới"  class="button" style= "text-align: left;"  onClick="create();"> 
	</div>
</td>
</tr>
</table>

<div id="sections">

<table width="100%" id="customers">
	<tr valign="bottom">
		<th >Mã đơn vị</th>
		<th >Tên đơn vị</th>
		<th >Mã số thuế</th>
		<th >Địa chỉ</th>
		<th >Điện thoại</th>
		<th >Fax</th>

		<th >Đại diện</th>
		<th align="right">{translate key="common.action"}</th>
	</tr>

	

{assign var="stt" value="0"}
<p align = "right" id = "danhmucDV_ND" style="color: #0000FF; font-size: 1em"> {$dktim}</b> # {$dmdvas|@count} dòng# ^F: Tìm kiếm </p>
 
{foreach from=$dmdvas item=dmdvs}
	{assign var="stt" value=$stt+1}
	<tr valign="top" >
			
			<td class="drag">{$dmdvs.MADV|escape}</td>
			<td class="drag">{$dmdvs.TENDV|escape}</td>
			<td class="drag">{$dmdvs.MASOTHUE|escape}</td>
			<td class="drag">{$dmdvs.DIACHI|escape}</td>
			<td class="drag">{$dmdvs.DIENTHOAI|escape}</td>
			<td class="drag">{$dmdvs.FAX|escape}</td>
			<td class="drag">{$dmdvs.DAIDIEN|escape}</td>
			<td align="right" class="nowrap">
			<a href="#" class="action" id ={$stt} onclick="editDMDV('{$dmdvs.MADV}', '{$dmdvs.TENDV|escape}', this.id)">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="DMDV_Del" path=$dmdvs.MADV}" onclick="return confirm('Ban muon xoa {$dmdvs.MADV}?')" class="action">{translate key="common.delete"}</a>
			</td>

	</tr>
{/foreach}

{*
{iterate from=dmdvas item=dmdv name=dmdvs}
	{if $stt ==0}
		{assign var="stt" value="1"}
		<tr valign="top" >
			{assign var = "madv" value = $dmdv->getmadv()}
			<td class="drag">{$dmdv['MADV']()|escape}</td>
			<td class="drag">{$dmdv['TENDV']()|escape}</td>
			<td class="drag"></td>
			<td align="right" class="nowrap">
				<a href="{url op="editdmdv" path=$dmdv->getmadv()}" class="action">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deletedmdv" path=$dmdv->getmadv()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $madv"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{else}
		{assign var="stt" value="0"}
		<tr valign="top" class="alt">
			{assign var = "madv" value = $dmdv->getmadv()}
			<td class="drag">{$dmdv->getmadv()|escape}</td>
			<td class="drag">{$dmdv->gettendv()|escape}</td>
			<td class="drag"></td>
			<td align="right" class="nowrap">
				<a href="{url op="editdmdv" path=$dmdv->getmadv()}" class="action">{translate key="common.edit"}</a>&nbsp;|&nbsp;<a href="{url op="deletedmdv" path=$dmdv->getmadv()}" onclick="return confirm('{translate|escape:"jsparam" key={"Xoa Tai Khoan  $madv"}}')" class="action">{translate key="common.delete"}</a>
			</td>
		</tr>
	{/if}

{/iterate}
*}



<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

</table>
</div>

{include file="common/footer.tpl"}

